package com.aaa.dem1031.d03;

/**
 * @Author: whj
 * @Version 1.0
 * @Date: 2022/10/31  15:35
 */
public class MyTicket implements Runnable{
    private int ticket=100;

    @Override
    public void run() {
        while (true){
            if (ticket>0){
                System.out.println(Thread.currentThread().getName()+"卖票一张,剩余："+ --ticket);
            }else {
                break;
            }
        }
    }
}
